<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="common.css">
        <title>GitLab dashboard</title>
    </head>
    <body>
        <h1>GitLab</h1>
        <div id="gitlab_config_div" class="a1">
            <form>
                GitLab Host:<br/>
                <input type="text" name="gitlab_host" id="gitlabhost">
                <br/>
                Access Token:<br/>
                <input type="text" name="access_token" id="accesstk">
                <br/>
                Feed Token:<br/>
                <input type="text" name="feed_token" id="feedtk"><br/>
                <button name="gitlab_config" id="gitlabconf">Config</button>
            </form>
            <script>
                const gitlab_conf = document.getElementById("gitlabconf")
                gitlab_conf.addEventListener('click', function() {
                    var gitlab_host = document.getElementById("gitlabhost").value
                    var gitlab_access_token = document.getElementById("accesstk").value
                    var gitlab_feed_token = document.getElementById("feedtk").value
                    const ipc = require("electron").ipcRenderer
                    ipc.send("gitlab_config", [ gitlab_host, gitlab_access_token, gitlab_feed_token ])
                })
            </script>
        </div>
        <div id="gitlab_test_div" class="a2">
            <button name="gitlab_test_conn" id="gitlabtestconn">Test Connection</button>
            <script>
                const gitlab_test_conn = document.getElementById("gitlabtestconn")
                gitlab_test_conn.addEventListener('click', function() {
                    const ipc = require("electron").ipcRenderer
                    ipc.send("gitlab_test", "connect_test")
                })
            </script>
        </div>
    </body>
</html>